<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/jquery-1.12.4.min.js"></script>
    <script>
        $(function () {

            var input1 = $(".input1");
            var input2 = $(".input2");

            var check1Prop = input1.prop("checked");
            var check1Attr = input1.attr("checked");
            console.log("check1Prop=" + check1Prop);//true
            console.log("check1Attr=" + check1Attr);//checked


            var check2Prop = input2.prop("checked");
            var check2Attr = input2.attr("checked");

            console.log("check2Prop=" + check2Prop);//false
            console.log("check2Attr=" + check2Attr);//undefined

            // 如果是自己本身的属性用 prop
            // 如果是自定义的就用 attr

        });
    </script>
</head>

<body>
    <!--checked = "checked"默认选中 可以简写-->
    <input type="checkbox" checked class="input1">吃
    <input type="checkbox" class="input2">喝

</body>

</html>